package com.tony.spring.mode.adapter;

/**
 * demoservice适配器
 * @author Tony
 *
 */
public class DemoServiceAdapter implements DemoService{
	
	// 依赖飞行接口
	private FlyService flyService;
	
	public DemoServiceAdapter(){
		this.flyService = new FlyServiceImpl();
	}

	@Override
	public void demo(String canFlag) throws Exception {
		if("fly".equals(canFlag)){
			flyService.fly();
		}
	}

}
